// 统一地址管理
// 请求 登录/查询
import request from "./request"
import qs from 'qs'
export const JingpinAPI = ()=> request.get("/products/recommend")
export const ReMenAPI = () => request.get("/products/hot")

// 请求验证码
export const SendSMSAPI = parmas => request.post("/sendSMS", qs.stringify(parmas))
// 手机号校验 验证码 登录请求
export const PhoneReginAPI = parmas => request.post("/phoneRegin", qs.stringify(parmas))

//微信扫码登录
export const WxLoginAPI = (params) => request.post('/wechatUsers/PCLogin', qs.stringify(params));

//手机绑定微信请求
export const BindPhoneAPI = (params) => request.post('/wechatUsers/binding', qs.stringify(params));
// 获取登录用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");
// 请求详情页的数据
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
// 加入到购物车
export const AddToCartAPI = (params) => request.post('/shop/carts/add', qs.stringify(params));
// 商品搜索（含首页的“更多”）
export const GoodsSearchAPI = (params) => request.get('/products', { params });
// 请求购物车数据
export const CartDataAPI = () => request.get('/shop/carts');
//删除商品
// s?productIds={id}
export const RemoveCartAPI = (params) => request.delete(`/shop/carts?productIds=${params.id}`);